Remove "Died" support from the hotplug monitoring. This error code was used
authoremellor@leeni.uk.xensource.com <emellor@leeni.uk.xensource.com>
Tue, 3 Jan 2006 16:28:00 +0000 (16:28 +0000)
committeremellor@leeni.uk.xensource.com <emellor@leeni.uk.xensource.com>
Tue, 3 Jan 2006 16:28:00 +0000 (16:28 +0000)
when hotplugStatusCallback raised VmError, but this can no longer happen.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
tools/python/xen/xend/server/DevController.py

index 814b9405c631cb9bc6eb58dc8fbe9a2068462044..6faadeb24ecf34f30e5cde327252c959515352ba 100644 (file)
@@ -32,11 +32,10 @@ HOTPLUG_STATUS_ERROR = "error"
 HOTPLUG_STATUS_BUSY  = "busy"
 
 Connected = 1
-Died      = 2
-Error     = 3
-Missing   = 4
-Timeout   = 5
-Busy      = 6
+Error     = 2
+Missing   = 3
+Timeout   = 4
+Busy      = 5
 
 xenbusState = {
     'Unknown'      : 0,
@@ -157,11 +156,6 @@ class DevController:
             raise VmError("Device %s (%s) could not be connected. "
                           "Device not found." % (devid, self.deviceClass))
 
-        elif status == Died:
-            self.destroyDevice(devid)
-            raise VmError("Device %s (%s) could not be connected. "
-                          "Device has died." % (devid, self.deviceClass))
-
         elif status == Busy:
             err = None
             frontpath = self.frontendPath(devid)
@@ -408,20 +402,17 @@ class DevController:
 def hotplugStatusCallback(statusPath, ev, result):
     log.debug("hotplugStatusCallback %s.", statusPath)
 
-    try:
-        status = xstransact.Read(statusPath)
+    status = xstransact.Read(statusPath)
 
-        if status is not None:
-            if status == HOTPLUG_STATUS_ERROR:
-                result['status'] = Error
-            elif status == HOTPLUG_STATUS_BUSY:
-                result['status'] = Busy
-            else:
-                result['status'] = Connected
+    if status is not None:
+        if status == HOTPLUG_STATUS_ERROR:
+            result['status'] = Error
+        elif status == HOTPLUG_STATUS_BUSY:
+            result['status'] = Busy
         else:
-            return 1
-    except VmError:
-        result['status'] = Died
+            result['status'] = Connected
+    else:
+        return 1
 
     log.debug("hotplugStatusCallback %d.", result['status'])